<?php
require_once('smarty_default.php');

$catalog_arr = $dbobject->query('select * from catalogs order by `order`',MYSQL_ASSOC);

$thongtin_arr = array();
foreach ($catalog_arr as $value)
{
	$id = $value['id'];
	$thongtin_arr =array_merge($thongtin_arr,$dbobject->query('SELECT thongtins.id, thongtins.title, thongtins.sabo, thongtins.img_name_alias, thongtins.img_name_truth, catalogs.name AS catalog_name
	FROM thongtins
	LEFT JOIN catalogs ON thongtins.catolog_id = catalogs.id
	WHERE thongtins.catolog_id = ' . $id.
	' AND `active` LIKE ' . "'1'".
	'ORDER BY id DESC
	LIMIT 3',MYSQL_ASSOC));

}



$smarty->assign('catalog_arr',$catalog_arr);

$smarty->assign('thongtin_arr',$thongtin_arr);

$smarty->display('index/index.tpl');
?>